Storage System With Distributed Deletion

ABSTRACT

A method of distributed file deletion, performed by a storage system, is provided. The method includes receiving, at the storage system, a request to delete a directory and contents of the directory and adding the directory to a first set, listed in a memory in the storage system. The method includes operating on the first set, by examining each directory in the first set to identify subdirectories, adding each identified subdirectory to the first set as a directory, and adding each examined directory to a second set listed in the memory. The method includes deleting in a distributed manner across the storage system without concern for order, contents of directories, and the directories listed in the second set.

CROSS REFERENCE TO RELATED APPLICATIONS

This is a continuation application for patent entitled to a filing dateand claiming the benefit of earlier-filed U.S. patent application Ser.No. 16/863,464, filed Apr. 30, 2020, herein incorporated by reference inits entirety, which is a continuation of U.S. Pat. No. 10,678,452,issued Jun. 9, 2020, which claims priority from a U.S. ProvisionalApplication No. 62/395,338, filed Sep. 15, 2016, each of which is herebyincorporated by reference in their entirety.

BACKGROUND

With traditional file system kernels, to delete a directory a user mustfirst traverse the entire directory and delete files and subdirectoriesfrom the bottom up, starting with the leafs (or leaves). Only when allof the contents of the parent directory have been manually deleted canthe parent directory be deleted, for example using the UNIX commandrmdir. The remove directory command, rmdir directory_name, will onlyremove an empty directory. There is a UNIX command that will remove adirectory and all of the contents of the directory, however, thesecommands require the user specify the entire directory tree. Inaddition, the operating system that is interpreting the command muststill communicate with the file system to do the directory tree tracingfrom the top down, and removal of the leafs from bottom-up, which incursa lot of communication overhead. Other equivalent commands for deletingan entire tree for other operating systems exist, but in all of thesealternatives deletion occurs from bottom-up through the tree after thedirectory tree is first traced from top-down. Each subdirectory is onlydeleted after it is emptied. Deletion of the top directory must waituntil all subdirectories below it have been emptied. The abovemechanisms while arguably suitable for hard disk drives, are notoptimized for solid-state media.

Solid-state memory, such as flash, is currently in use in solid-statedrives (SSD) to augment or replace conventional hard disk drives (HDD),writable CD (compact disk) or writable DVD (digital versatile disk)drives, collectively known as spinning media, and tape drives, forstorage of large amounts of data. Flash and other solid-state memorieshave characteristics that differ from spinning media. Yet, manysolid-state drives are designed to conform to hard disk drive standardsfor compatibility reasons, which makes it difficult to provide enhancedfeatures or take advantage of unique aspects of flash and othersolid-state memory. It is within this context that the embodimentsarise.

SUMMARY

In some embodiments, a method of distributed file deletion, performed bya storage system, is provided. The method includes receiving, at thestorage system, a request to delete a directory and contents of thedirectory and adding the directory to a first set, listed in a memory inthe storage system. The method includes operating on the first set, byexamining each directory in the first set to identify subdirectories,adding each identified subdirectory to the first set as a directory, andadding each examined directory to a second set listed in the memory. Themethod includes deleting in a distributed manner across the storagesystem without concern for order, contents of directories, and thedirectories, listed in the second set. The method may be embodied on acomputer readable medium or executed by a storage system in someembodiments.

Other aspects and advantages of the embodiments will become apparentfrom the following detailed description taken in conjunction with theaccompanying drawings which illustrate, by way of example, theprinciples of the described embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

The described embodiments and the advantages thereof may best beunderstood by reference to the following description taken inconjunction with the accompanying drawings. These drawings in no waylimit any changes in form and detail that may be made to the describedembodiments by one skilled in the art without departing from the spiritand scope of the described embodiments.

FIG. 1 is a perspective view of a storage cluster with multiple storagenodes and internal storage coupled to each storage node to providenetwork attached storage, in accordance with some embodiments.

FIG. 2 is a block diagram showing an interconnect switch couplingmultiple storage nodes in accordance with some embodiments.

FIG. 3 is a multiple level block diagram, showing contents of a storagenode and contents of one of the non-volatile solid state storage unitsin accordance with some embodiments.

FIG. 4 shows a storage server environment, which uses embodiments of thestorage nodes and storage units of FIGS. 1-3 in accordance with someembodiments.

FIG. 5 is a blade hardware block diagram, showing a control plane,compute and storage planes, and authorities interacting with underlyingphysical resources, in accordance with some embodiments.

FIG. 6 depicts elasticity software layers in blades of a storagecluster, in accordance with some embodiments.

FIG. 7 depicts authorities and storage resources in blades of a storagecluster, in accordance with some embodiments.

FIG. 8A is an action diagram showing a directory tree and aspecial-named directory for deleting a specified directory and theentire tree below that directory.

FIG. 8B continues the action diagram of FIG. 8A, and shows top-downiterative or recursive listing of a directory, subdirectories and filesin a trash list, in some embodiments performed by processors on behalfof authorities, in iterative search and destroy processes with batchcommunication and background deletions.

FIG. 9A is a flow diagram of a method for distributed directory and filedeletion of a directory tree, which can be practiced in the storagecluster of FIGS. 1-5 , and in further storage systems, in accordancewith some embodiments as described with reference to FIGS. 6 and 7 .

FIG. 9B is a further flow diagram of a method for recovery from powerloss, which can be practiced to augment the method of FIG. 9A.

FIG. 10 is a further flow diagram of a method for distributed directoryand file deletion of a directory tree, as a variation of the methodshown in FIG. 8 .

FIG. 11 is an illustration showing an exemplary computing device whichmay implement the embodiments described herein.

DETAILED DESCRIPTION

Various mechanisms described herein efficiently delete a directory andan entire directory tree extending from the specified directory, withoutrequiring the user to manually specify an entire directory tree or havean operating system or file system communicate requests for deletion ofeach file and each subdirectory to a storage system. Instead of tracinga directory tree from top-down, then deleting leafs from bottom-up andonly deleting subdirectories when empty, as is usually the case in filesystems, various embodiments of a storage system perform iterativesearch and destroy processes and background deletions in parallel forgreater efficiency and decreased latency in response to a request todelete a directory tree. In some embodiments, a special-named directoryis established for deletion of an entire directory tree. FIGS. 1-7 showvarious embodiments of a storage cluster, with storage nodes andsolid-state storage units suitable for embodiments that practicedistributed directory and file deletion. FIGS. 8A-10 show aspects ofdistributed file deletion, and distributed directory deletion.

The embodiments below describe a storage cluster that stores user data,such as user data originating from one or more user or client systems orother sources external to the storage cluster. The storage clusterdistributes user data across storage nodes housed within a chassis,using erasure coding and redundant copies of metadata. Erasure codingrefers to a method of data protection or reconstruction in which data isstored across a set of different locations, such as disks, storage nodesor geographic locations. Flash memory is one type of solid-state memorythat may be integrated with the embodiments, although the embodimentsmay be extended to other types of solid-state memory or other storagemedium, including non-solid state memory. Control of storage locationsand workloads are distributed across the storage locations in aclustered peer-to-peer system. Tasks such as mediating communicationsbetween the various storage nodes, detecting when a storage node hasbecome unavailable, and balancing I/Os (inputs and outputs) across thevarious storage nodes, are all handled on a distributed basis. Data islaid out or distributed across multiple storage nodes in data fragmentsor stripes that support data recovery in some embodiments. Ownership ofdata can be reassigned within a cluster, independent of input and outputpatterns. This architecture described in more detail below allows astorage node in the cluster to fail, with the system remainingoperational, since the data can be reconstructed from other storagenodes and thus remain available for input and output operations. Invarious embodiments, a storage node may be referred to as a clusternode, a blade, or a server.

The storage cluster is contained within a chassis, i.e., an enclosurehousing one or more storage nodes. A mechanism to provide power to eachstorage node, such as a power distribution bus, and a communicationmechanism, such as a communication bus that enables communicationbetween the storage nodes are included within the chassis. The storagecluster can run as an independent system in one location according tosome embodiments. In one embodiment, a chassis contains at least twoinstances of both the power distribution and the communication bus whichmay be enabled or disabled independently. The internal communication busmay be an Ethernet bus, however, other technologies such as PeripheralComponent Interconnect (PCI) Express, InfiniBand, and others, areequally suitable. The chassis provides a port for an externalcommunication bus for enabling communication between multiple chassis,directly or through a switch, and with client systems. The externalcommunication may use a technology such as Ethernet, InfiniBand, FibreChannel, etc. In some embodiments, the external communication bus usesdifferent communication bus technologies for inter-chassis and clientcommunication. If a switch is deployed within or between chassis, theswitch may act as a translation between multiple protocols ortechnologies. When multiple chassis are connected to define a storagecluster, the storage cluster may be accessed by a client using eitherproprietary interfaces or standard interfaces such as network filesystem (NFS), common internet file system (CIFS), small computer systeminterface (SCSI) or hypertext transfer protocol (HTTP). Translation fromthe client protocol may occur at the switch, chassis externalcommunication bus or within each storage node.

Each storage node may be one or more storage servers and each storageserver is connected to one or more non-volatile solid state memoryunits, which may be referred to as storage units or storage devices. Oneembodiment includes a single storage server in each storage node andbetween one to eight non-volatile solid state memory units, however thisone example is not meant to be limiting. The storage server may includea processor, dynamic random access memory (DRAM) and interfaces for theinternal communication bus and power distribution for each of the powerbuses. Inside the storage node, the interfaces and storage unit share acommunication bus, e.g., PCI Express, in some embodiments. Thenon-volatile solid state memory units may directly access the internalcommunication bus interface through a storage node communication bus, orrequest the storage node to access the bus interface. The non-volatilesolid state memory unit contains an embedded central processing unit(CPU), solid state storage controller, and a quantity of solid statemass storage, e.g., between 2-32 terabytes (TB) in some embodiments. Anembedded volatile storage medium, such as DRAM, and an energy reserveapparatus are included in the non-volatile solid state memory unit. Insome embodiments, the energy reserve apparatus is a capacitor,super-capacitor, or battery that enables transferring a subset of DRAMcontents to a stable storage medium in the case of power loss. In someembodiments, the non-volatile solid state memory unit is constructedwith a storage class memory, such as phase change or magnetoresistiverandom access memory (MRAM) that substitutes for DRAM and enables areduced power hold-up apparatus.

One of many features of the storage nodes and non-volatile solid statestorage is the ability to proactively rebuild data in a storage cluster.The storage nodes and non-volatile solid state storage can determinewhen a storage node or non-volatile solid state storage in the storagecluster is unreachable, independent of whether there is an attempt toread data involving that storage node or non-volatile solid statestorage. The storage nodes and non-volatile solid state storage thencooperate to recover and rebuild the data in at least partially newlocations. This constitutes a proactive rebuild, in that the systemrebuilds data without waiting until the data is needed for a read accessinitiated from a client system employing the storage cluster. These andfurther details of the storage memory and operation thereof arediscussed below.

FIG. 1 is a perspective view of a storage cluster 160, with multiplestorage nodes 150 and internal solid-state memory coupled to eachstorage node to provide network attached storage or storage areanetwork, in accordance with some embodiments. A network attachedstorage, storage area network, or a storage cluster, or other storagememory, could include one or more storage clusters 160, each having oneor more storage nodes 150, in a flexible and reconfigurable arrangementof both the physical components and the amount of storage memoryprovided thereby. The storage cluster 160 is designed to fit in a rack,and one or more racks can be set up and populated as desired for thestorage memory. The storage cluster 160 has a chassis 138 havingmultiple slots 142. It should be appreciated that chassis 138 may bereferred to as a housing, enclosure, or rack unit. In one embodiment,the chassis 138 has fourteen slots 142, although other numbers of slotsare readily devised. For example, some embodiments have four slots,eight slots, sixteen slots, thirty-two slots, or other suitable numberof slots. Each slot 142 can accommodate one storage node 150 in someembodiments. Chassis 138 includes flaps 148 that can be utilized tomount the chassis 138 on a rack. Fans 144 provide air circulation forcooling of the storage nodes 150 and components thereof, although othercooling components could be used, or an embodiment could be devisedwithout cooling components. A switch fabric 146 couples storage nodes150 within chassis 138 together and to a network for communication tothe memory. In an embodiment depicted in FIG. 1 , the slots 142 to theleft of the switch fabric 146 and fans 144 are shown occupied by storagenodes 150, while the slots 142 to the right of the switch fabric 146 andfans 144 are empty and available for insertion of storage node 150 forillustrative purposes. This configuration is one example, and one ormore storage nodes 150 could occupy the slots 142 in various furtherarrangements. The storage node arrangements need not be sequential oradjacent in some embodiments. Storage nodes 150 are hot pluggable,meaning that a storage node 150 can be inserted into a slot 142 in thechassis 138, or removed from a slot 142, without stopping or poweringdown the system. Upon insertion or removal of storage node 150 from slot142, the system automatically reconfigures in order to recognize andadapt to the change. Reconfiguration, in some embodiments, includesrestoring redundancy and/or rebalancing data or load.

Each storage node 150 can have multiple components. In the embodimentshown here, the storage node 150 includes a printed circuit board 158populated by a CPU 156, i.e., processor, a memory 154 coupled to the CPU156, and a non-volatile solid state storage 152 coupled to the CPU 156,although other mountings and/or components could be used in furtherembodiments. The memory 154 has instructions which are executed by theCPU 156 and/or data operated on by the CPU 156. As further explainedbelow, the non-volatile solid state storage 152 includes flash or, infurther embodiments, other types of solid-state memory.

Referring to FIG. 1 , storage cluster 160 is scalable, meaning thatstorage capacity with non-uniform storage sizes is readily added, asdescribed above. One or more storage nodes 150 can be plugged into orremoved from each chassis and the storage cluster self-configures insome embodiments. Plug-in storage nodes 150, whether installed in achassis as delivered or later added, can have different sizes. Forexample, in one embodiment a storage node 150 can have any multiple of 4TB, e.g., 8 TB, 12 TB, 16 TB, 32 TB, etc. In further embodiments, astorage node 150 could have any multiple of other storage amounts orcapacities. Storage capacity of each storage node 150 is broadcast, andinfluences decisions of how to stripe the data. For maximum storageefficiency, an embodiment can self-configure as wide as possible in thestripe, subject to a predetermined requirement of continued operationwith loss of up to one, or up to two, non-volatile solid state storageunits 152 or storage nodes 150 within the chassis.

FIG. 2 is a block diagram showing a communications interconnect 170 andpower distribution bus 172 coupling multiple storage nodes 150.Referring back to FIG. 1 , the communications interconnect 170 can beincluded in or implemented with the switch fabric 146 in someembodiments. Where multiple storage clusters 160 occupy a rack, thecommunications interconnect 170 can be included in or implemented with atop of rack switch, in some embodiments. As illustrated in FIG. 2 ,storage cluster 160 is enclosed within a single chassis 138. Externalport 176 is coupled to storage nodes 150 through communicationsinterconnect 170, while external port 174 is coupled directly to astorage node. External power port 178 is coupled to power distributionbus 172. Storage nodes 150 may include varying amounts and differingcapacities of non-volatile solid state storage 152 as described withreference to FIG. 1 . In addition, one or more storage nodes 150 may bea compute only storage node as illustrated in FIG. 2 . Authorities 168are implemented on the non-volatile solid state storages 152, forexample as lists or other data structures stored in memory. In someembodiments the authorities are stored within the non-volatile solidstate storage 152 and supported by software executing on a controller orother processor of the non-volatile solid state storage 152. In afurther embodiment, authorities 168 are implemented on the storage nodes150, for example as lists or other data structures stored in the memory154 and supported by software executing on the CPU 156 of the storagenode 150. Authorities 168 control how and where data is stored in thenon-volatile solid state storages 152 in some embodiments. This controlassists in determining which type of erasure coding scheme is applied tothe data, and which storage nodes 150 have which portions of the data.Each authority 168 may be assigned to a non-volatile solid state storage152. Each authority may control a range of inode numbers, segmentnumbers, or other data identifiers which are assigned to data by a filesystem, by the storage nodes 150, or by the non-volatile solid statestorage 152, in various embodiments.

Every piece of data, and every piece of metadata, has redundancy in thesystem in some embodiments. In addition, every piece of data and everypiece of metadata has an owner, which may be referred to as anauthority. If that authority is unreachable, for example through failureof a storage node, there is a plan of succession for how to find thatdata or that metadata. In various embodiments, there are redundantcopies of authorities 168. Authorities 168 have a relationship tostorage nodes 150 and non-volatile solid state storage 152 in someembodiments. Each authority 168, covering a range of data segmentnumbers or other identifiers of the data, may be assigned to a specificnon-volatile solid state storage 152. In some embodiments theauthorities 168 for all of such ranges are distributed over thenon-volatile solid state storages 152 of a storage cluster. Each storagenode 150 has a network port that provides access to the non-volatilesolid state storage(s) 152 of that storage node 150. Data can be storedin a segment, which is associated with a segment number and that segmentnumber is an indirection for a configuration of a RAID (redundant arrayof independent disks) stripe in some embodiments. The assignment and useof the authorities 168 thus establishes an indirection to data.Indirection may be referred to as the ability to reference dataindirectly, in this case via an authority 168, in accordance with someembodiments. A segment identifies a set of non-volatile solid statestorage 152 and a local identifier into the set of non-volatile solidstate storage 152 that may contain data. In some embodiments, the localidentifier is an offset into the device and may be reused sequentiallyby multiple segments. In other embodiments the local identifier isunique for a specific segment and never reused. The offsets in thenon-volatile solid state storage 152 are applied to locating data forwriting to or reading from the non-volatile solid state storage 152 (inthe form of a RAID stripe). Data is striped across multiple units ofnon-volatile solid state storage 152, which may include or be differentfrom the non-volatile solid state storage 152 having the authority 168for a particular data segment.

If there is a change in where a particular segment of data is located,e.g., during a data move or a data reconstruction, the authority 168 forthat data segment should be consulted, at that non-volatile solid statestorage 152 or storage node 150 having that authority 168. In order tolocate a particular piece of data, embodiments calculate a hash valuefor a data segment or apply an inode number or a data segment number.The output of this operation points to a non-volatile solid statestorage 152 having the authority 168 for that particular piece of data.In some embodiments there are two stages to this operation. The firststage maps an entity identifier (ID), e.g., a segment number, inodenumber, or directory number to an authority identifier. This mapping mayinclude a calculation such as a hash or a bit mask. The second stage ismapping the authority identifier to a particular non-volatile solidstate storage 152, which may be done through an explicit mapping. Theoperation is repeatable, so that when the calculation is performed, theresult of the calculation repeatably and reliably points to a particularnon-volatile solid state storage 152 having that authority 168. Theoperation may include the set of reachable storage nodes as input. Ifthe set of reachable non-volatile solid state storage units changes theoptimal set changes. In some embodiments, the persisted value is thecurrent assignment (which is always true) and the calculated value isthe target assignment the cluster will attempt to reconfigure towards.This calculation may be used to determine the optimal non-volatile solidstate storage 152 for an authority in the presence of a set ofnon-volatile solid state storage 152 that are reachable and constitutethe same cluster. The calculation also determines an ordered set of peernon-volatile solid state storage 152 that will also record the authorityto non-volatile solid state storage mapping so that the authority may bedetermined even if the assigned non-volatile solid state storage isunreachable. A duplicate or substitute authority 168 may be consulted ifa specific authority 168 is unavailable in some embodiments.

With reference to FIGS. 1 and 2 , two of the many tasks of the CPU 156on a storage node 150 are to break up write data, and reassemble readdata. When the system has determined that data is to be written, theauthority 168 for that data is located as above. When the segment ID fordata is already determined the request to write is forwarded to thenon-volatile solid state storage 152 currently determined to be the hostof the authority 168 determined from the segment. The host CPU 156 ofthe storage node 150, on which the non-volatile solid state storage 152and corresponding authority 168 reside, then breaks up or shards thedata and transmits the data out to various non-volatile solid statestorage 152. The transmitted data is written as a data stripe inaccordance with an erasure coding scheme. In some embodiments, data isrequested to be pulled, and in other embodiments, data is pushed. Inreverse, when data is read, the authority 168 for the segment IDcontaining the data is located as described above. The host CPU 156 ofthe storage node 150 on which the non-volatile solid state storage 152and corresponding authority 168 reside requests the data from thenon-volatile solid state storage and corresponding storage nodes pointedto by the authority. In some embodiments the data is read from flashstorage as a data stripe. The host CPU 156 of storage node 150 thenreassembles the read data, correcting any errors (if present) accordingto the appropriate erasure coding scheme, and forwards the reassembleddata to the network. In further embodiments, some or all of these taskscan be handled in the non-volatile solid state storage 152. In someembodiments, the segment host requests the data be sent to storage node150 by requesting pages from storage and then sending the data to thestorage node making the original request.

In some systems, for example in UNIX-style file systems, data is handledwith an index node or inode, which specifies a data structure thatrepresents an object in a file system. The object could be a file or adirectory, for example. Metadata may accompany the object, as attributessuch as permission data and a creation timestamp, among otherattributes. A segment number could be assigned to all or a portion ofsuch an object in a file system. In other systems, data segments arehandled with a segment number assigned elsewhere. For purposes ofdiscussion, the unit of distribution is an entity, and an entity can bea file, a directory or a segment. That is, entities are units of data ormetadata stored by a storage system. Entities are grouped into setscalled authorities. Each authority has an authority owner, which is astorage node that has the exclusive right to update the entities in theauthority. In other words, a storage node contains the authority, andthat the authority, in turn, contains entities.

A segment is a logical container of data in accordance with someembodiments. A segment is an address space between medium address spaceand physical flash locations, i.e., the data segment number, are in thisaddress space. Segments may also contain meta-data, which enable dataredundancy to be restored (rewritten to different flash locations ordevices) without the involvement of higher level software. In oneembodiment, an internal format of a segment contains client data andmedium mappings to determine the position of that data. Each datasegment is protected, e.g., from memory and other failures, by breakingthe segment into a number of data and parity shards, where applicable.The data and parity shards are distributed, i.e., striped, acrossnon-volatile solid state storage 152 coupled to the host CPUs 156 (SeeFIGS. 5 and 7 ) in accordance with an erasure coding scheme. Usage ofthe term segments refers to the container and its place in the addressspace of segments in some embodiments. Usage of the term stripe refersto the same set of shards as a segment and includes how the shards aredistributed along with redundancy or parity information in accordancewith some embodiments.

A series of address-space transformations takes place across an entirestorage system. At the top are the directory entries (file names) whichlink to an inode. Inodes point into medium address space, where data islogically stored. Medium addresses may be mapped through a series ofindirect mediums to spread the load of large files, or implement dataservices like deduplication or snapshots. Medium addresses may be mappedthrough a series of indirect mediums to spread the load of large files,or implement data services like deduplication or snapshots. Segmentaddresses are then translated into physical flash locations. Physicalflash locations have an address range bounded by the amount of flash inthe system in accordance with some embodiments. Medium addresses andsegment addresses are logical containers, and in some embodiments use a128 bit or larger identifier so as to be practically infinite, with alikelihood of reuse calculated as longer than the expected life of thesystem. Addresses from logical containers are allocated in ahierarchical fashion in some embodiments. Initially, each non-volatilesolid state storage unit 152 may be assigned a range of address space.Within this assigned range, the non-volatile solid state storage 152 isable to allocate addresses without synchronization with othernon-volatile solid state storage 152.

Data and metadata is stored by a set of underlying storage layouts thatare optimized for varying workload patterns and storage devices. Theselayouts incorporate multiple redundancy schemes, compression formats andindex algorithms. Some of these layouts store information aboutauthorities and authority masters, while others store file metadata andfile data. The redundancy schemes include error correction codes thattolerate corrupted bits within a single storage device (such as a NANDflash chip), erasure codes that tolerate the failure of multiple storagenodes, and replication schemes that tolerate data center or regionalfailures. In some embodiments, low density parity check (LDPC) code isused within a single storage unit. Reed-Solomon encoding is used withina storage cluster, and mirroring is used within a storage grid in someembodiments. Metadata may be stored using an ordered log structuredindex (such as a Log Structured Merge Tree), and large data may not bestored in a log structured layout.

In order to maintain consistency across multiple copies of an entity,the storage nodes agree implicitly on two things through calculations:(1) the authority that contains the entity, and (2) the storage nodethat contains the authority. The assignment of entities to authoritiescan be done by pseudo randomly assigning entities to authorities, bysplitting entities into ranges based upon an externally produced key, orby placing a single entity into each authority. Examples of pseudorandomschemes are linear hashing and the Replication Under Scalable Hashing(RUSH) family of hashes, including Controlled Replication Under ScalableHashing (CRUSH). In some embodiments, pseudo-random assignment isutilized only for assigning authorities to nodes because the set ofnodes can change. The set of authorities cannot change so any subjectivefunction may be applied in these embodiments. Some placement schemesautomatically place authorities on storage nodes, while other placementschemes rely on an explicit mapping of authorities to storage nodes. Insome embodiments, a pseudorandom scheme is utilized to map from eachauthority to a set of candidate authority owners. A pseudorandom datadistribution function related to CRUSH may assign authorities to storagenodes and create a list of where the authorities are assigned. Eachstorage node has a copy of the pseudorandom data distribution function,and can arrive at the same calculation for distributing, and laterfinding or locating an authority. Each of the pseudorandom schemesrequires the reachable set of storage nodes as input in some embodimentsin order to conclude the same target nodes. Once an entity has beenplaced in an authority, the entity may be stored on physical devices sothat no expected failure will lead to unexpected data loss. In someembodiments, rebalancing algorithms attempt to store the copies of allentities within an authority in the same layout and on the same set ofmachines.

Examples of expected failures include device failures, stolen machines,datacenter fires, and regional disasters, such as nuclear or geologicalevents. Different failures lead to different levels of acceptable dataloss. In some embodiments, a stolen storage node impacts neither thesecurity nor the reliability of the system, while depending on systemconfiguration, a regional event could lead to no loss of data, a fewseconds or minutes of lost updates, or even complete data loss.

In the embodiments, the placement of data for storage redundancy isindependent of the placement of authorities for data consistency. Insome embodiments, storage nodes that contain authorities do not containany persistent storage. Instead, the storage nodes are connected tonon-volatile solid state storage units that do not contain authorities.The communications interconnect between storage nodes and non-volatilesolid state storage units consists of multiple communicationtechnologies and has non-uniform performance and fault tolerancecharacteristics. In some embodiments, as mentioned above, non-volatilesolid state storage units are connected to storage nodes via PCIexpress, storage nodes are connected together within a single chassisusing Ethernet backplane, and chassis are connected together to form astorage cluster. Storage clusters are connected to clients usingEthernet or fiber channel in some embodiments. If multiple storageclusters are configured into a storage grid, the multiple storageclusters are connected using the Internet or other long-distancenetworking links, such as a “metro scale” link or private link that doesnot traverse the internet.

Authority owners have the exclusive right to modify entities, to migrateentities from one non-volatile solid state storage unit to anothernon-volatile solid state storage unit, and to add and remove copies ofentities. This allows for maintaining the redundancy of the underlyingdata. When an authority owner fails, is going to be decommissioned, oris overloaded, the authority is transferred to a new storage node.Transient failures make it non-trivial to ensure that all non-faultymachines agree upon the new authority location. The ambiguity thatarises due to transient failures can be achieved automatically by aconsensus protocol such as Paxos, hot-warm failover schemes, via manualintervention by a remote system administrator, or by a local hardwareadministrator (such as by physically removing the failed machine fromthe cluster, or pressing a button on the failed machine). In someembodiments, a consensus protocol is used, and failover is automatic. Iftoo many failures or replication events occur in too short a timeperiod, the system goes into a self-preservation mode and haltsreplication and data movement activities until an administratorintervenes in accordance with some embodiments.

As authorities are transferred between storage nodes and authorityowners update entities in their authorities, the system transfersmessages between the storage nodes and non-volatile solid state storageunits. With regard to persistent messages, messages that have differentpurposes are of different types. Depending on the type of the message,the system maintains different ordering and durability guarantees. Asthe persistent messages are being processed, the messages aretemporarily stored in multiple durable and non-durable storage hardwaretechnologies. In some embodiments, messages are stored in RAM, NVRAM andon NAND flash devices, and a variety of protocols are used in order tomake efficient use of each storage medium. Latency-sensitive clientrequests may be persisted in replicated NVRAM, and then later NAND,while background rebalancing operations are persisted directly to NAND.

Persistent messages are persistently stored prior to being transmitted.This allows the system to continue to serve client requests despitefailures and component replacement. Although many hardware componentscontain unique identifiers that are visible to system administrators,manufacturer, hardware supply chain and ongoing monitoring qualitycontrol infrastructure, applications running on top of theinfrastructure address virtualize addresses. These virtualized addressesdo not change over the lifetime of the storage system, regardless ofcomponent failures and replacements. This allows each component of thestorage system to be replaced over time without reconfiguration ordisruptions of client request processing.

In some embodiments, the virtualized addresses are stored withsufficient redundancy. A continuous monitoring system correlateshardware and software status and the hardware identifiers. This allowsdetection and prediction of failures due to faulty components andmanufacturing details. The monitoring system also enables the proactivetransfer of authorities and entities away from impacted devices beforefailure occurs by removing the component from the critical path in someembodiments.

FIG. 3 is a multiple level block diagram, showing contents of a storagenode 150 and contents of a non-volatile solid state storage 152 of thestorage node 150. Data is communicated to and from the storage node 150by a network interface controller (NIC) 202 in some embodiments. Eachstorage node 150 has a CPU 156, and one or more non-volatile solid statestorage 152, as discussed above. Moving down one level in FIG. 3 , eachnon-volatile solid state storage 152 has a relatively fast non-volatilesolid state memory, such as nonvolatile random access memory (NVRAM)204, and flash memory 206. In some embodiments, NVRAM 204 may be acomponent that does not require program/erase cycles (DRAM, MRAM, PCM),and can be a memory that can support being written vastly more oftenthan the memory is read from. Moving down another level in FIG. 3 , theNVRAM 204 is implemented in one embodiment as high speed volatilememory, such as dynamic random access memory (DRAM) 216, backed up byenergy reserve 218. Energy reserve 218 provides sufficient electricalpower to keep the DRAM 216 powered long enough for contents to betransferred to the flash memory 206 in the event of power failure. Insome embodiments, energy reserve 218 is a capacitor, super-capacitor,battery, or other device, that supplies a suitable supply of energysufficient to enable the transfer of the contents of DRAM 216 to astable storage medium in the case of power loss. The flash memory 206 isimplemented as multiple flash dies 222, which may be referred to aspackages of flash dies 222 or an array of flash dies 222. It should beappreciated that the flash dies 222 could be packaged in any number ofways, with a single die per package, multiple dies per package (i.e.multichip packages), in hybrid packages, as bare dies on a printedcircuit board or other substrate, as encapsulated dies, etc. In theembodiment shown, the non-volatile solid state storage 152 has acontroller 212 or other processor, and an input output (I/O) port 210coupled to the controller 212. I/O port 210 is coupled to the CPU 156and/or the network interface controller 202 of the flash storage node150. Flash input output (I/O) port 220 is coupled to the flash dies 222,and a direct memory access unit (DMA) 214 is coupled to the controller212, the DRAM 216 and the flash dies 222. In the embodiment shown, theI/O port 210, controller 212, DMA unit 214 and flash I/O port 220 areimplemented on a programmable logic device (PLD) 208, e.g., a fieldprogrammable gate array (FPGA). In this embodiment, each flash die 222has pages, organized as sixteen kB (kilobyte) pages 224, and a register226 through which data can be written to or read from the flash die 222.In further embodiments, other types of solid-state memory are used inplace of, or in addition to flash memory illustrated within flash die222.

Storage clusters 160, in various embodiments as disclosed herein, can becontrasted with storage arrays in general. The storage nodes 150 arepart of a collection that creates the storage cluster 160. Each storagenode 150 owns a slice of data and computing required to provide thedata. Multiple storage nodes 150 cooperate to store and retrieve thedata. Storage memory or storage devices, as used in storage arrays ingeneral, are less involved with processing and manipulating the data.Storage memory or storage devices in a storage array receive commands toread, write, or erase data. The storage memory or storage devices in astorage array are not aware of a larger system in which they areembedded, or what the data means. Storage memory or storage devices instorage arrays can include various types of storage memory, such as RAM,solid state drives, hard disk drives, etc. The storage units 152described herein have multiple interfaces active simultaneously andserving multiple purposes. In some embodiments, some of thefunctionality of a storage node 150 is shifted into a storage unit 152,transforming the storage unit 152 into a combination of storage unit 152and storage node 150. Placing computing (relative to storage data) intothe storage unit 152 places this computing closer to the data itself.The various system embodiments have a hierarchy of storage node layerswith different capabilities. By contrast, in a storage array, acontroller owns and knows everything about all of the data that thecontroller manages in a shelf or storage devices. In a storage cluster160, as described herein, multiple controllers in multiple storage units152 and/or storage nodes 150 cooperate in various ways (e.g., forerasure coding, data sharding, metadata communication and redundancy,storage capacity expansion or contraction, data recovery, and so on).

FIG. 4 shows a storage server environment, which uses embodiments of thestorage nodes 150 and storage units 152 of FIGS. 1-3 . In this version,each storage unit 152 has a processor such as controller 212 (see FIG. 3), an FPGA (field programmable gate array), flash memory 206, and NVRAM204 (which is super-capacitor backed DRAM 216, see FIGS. 2 and 3 ) on aPCIe (peripheral component interconnect express) board in a chassis 138(see FIG. 1 ). The storage unit 152 may be implemented as a single boardcontaining storage, and may be the largest tolerable failure domaininside the chassis. In some embodiments, up to two storage units 152 mayfail and the device will continue with no data loss.

The physical storage is divided into named regions based on applicationusage in some embodiments. The NVRAM 204 is a contiguous block ofreserved memory in the storage unit 152 DRAM 216, and is backed by NANDflash. NVRAM 204 is logically divided into multiple memory regionswritten for two as spool (e.g., spool_region). Space within the NVRAM204 spools is managed by each authority 512 independently. Each deviceprovides an amount of storage space to each authority 512. Thatauthority 512 further manages lifetimes and allocations within thatspace. Examples of a spool include distributed transactions or notions.When the primary power to a storage unit 152 fails, onboardsuper-capacitors provide a short duration of power hold up. During thisholdup interval, the contents of the NVRAM 204 are flushed to flashmemory 206. On the next power-on, the contents of the NVRAM 204 arerecovered from the flash memory 206.

As for the storage unit controller, the responsibility of the logical“controller” is distributed across each of the blades containingauthorities 512. This distribution of logical control is shown in FIG. 4as a host controller 402, mid-tier controller 404 and storage unitcontroller(s) 406. Management of the control plane and the storage planeare treated independently, although parts may be physically co-locatedon the same blade. Each authority 512 effectively serves as anindependent controller. Each authority 512 provides its own data andmetadata structures, its own background workers, and maintains its ownlifecycle.

FIG. 5 is a blade 502 hardware block diagram, showing a control plane504, compute and storage planes 506, 508, and authorities 512interacting with underlying physical resources, using embodiments of thestorage nodes 150 and storage units 152 of FIGS. 1-3 in the storageserver environment of FIG. 4 . The control plane 504 is partitioned intoa number of authorities 512 which can use the compute resources in thecompute plane 506 to run on any of the blades 502. The storage plane 508is partitioned into a set of devices, each of which provides access toflash 206 and NVRAM 204 resources.

In the compute and storage planes 506, 508 of FIG. 5 , the authorities512 interact with the underlying physical resources (i.e., devices).From the point of view of an authority 512, its resources are stripedover all of the physical devices. From the point of view of a device, itprovides resources to all authorities 512, irrespective of where theauthorities happen to run. Each authority 512 has allocated or has beenallocated one or more partitions 510 of storage memory in the storageunits 152, e.g. partitions 510 in flash memory 206 and NVRAM 204. Eachauthority 512 uses those allocated partitions 510 that belong to it, forwriting or reading user data. Authorities can be associated withdiffering amounts of physical storage of the system. For example, oneauthority 512 could have a larger number of partitions 510 or largersized partitions 510 in one or more storage units 152 than one or moreother authorities 512. Authorities 168 of FIG. 2 and authorities 512 ofFIG. 5 refer to the same construct.

FIG. 6 depicts elasticity software layers in blades 502 of a storagecluster 160, in accordance with some embodiments. In the elasticitystructure, elasticity software is symmetric, i.e., each blade's 502compute module 603 runs the three identical layers of processes depictedin FIG. 6 . Storage managers 607 execute read and write requests fromother blades 502 for data and metadata stored in local storage unit 152NVRAM 204 and flash 206. Authorities 168 fulfill client requests byissuing the necessary reads and writes to the blades 502 on whosestorage units 152 the corresponding data or metadata resides. Endpoints605 parse client connection requests received from switch fabric 146supervisory software, relay the client connection requests to theauthorities 168 responsible for fulfillment, and relay the authorities'168 responses to clients. The symmetric three-layer structure enablesthe storage system's high degree of concurrency. Elasticity scales outefficiently and reliably in these embodiments. In addition, elasticityimplements a unique scale-out technique that balances work evenly acrossall resources regardless of client access pattern, and maximizesconcurrency by eliminating much of the need for inter-blade coordinationthat typically occurs with conventional distributed locking.

Still referring to FIG. 6 , authorities 168 running in the computemodules 603 of a blade 502 perform the internal operations required tofulfill client requests. One feature of elasticity is that authorities168 are stateless, i.e., they cache active data and metadata in theirown blades' 168 DRAMs for fast access, but the authorities store everyupdate in their NVRAM 204 partitions on three separate blades 502 untilthe update has been written to flash 206. All the storage system writesto NVRAM 204 are in triplicate to partitions on three separate blades502 in some embodiments. With triple-mirrored NVRAM 204 and persistentstorage protected by parity and Reed-Solomon RAID checksums, the storagesystem can survive concurrent failure of two blades 502 with no loss ofdata, metadata, or access to either.

Because authorities 168 are stateless, they can migrate between blades502. Each authority 168 has a unique identifier. NVRAM 204 and flash 206partitions are associated with authorities' 168 identifiers, not withthe blades 502 on which they are running in some embodiments. Thus, whenan authority 168 migrates, the authority 168 continues to manage thesame storage partitions from its new location. When a new blade 502 isinstalled in an embodiment of the storage cluster 160, the systemautomatically rebalances load by:

-   -   Partitioning the new blade's 502 storage for use by the system's        authorities 168,    -   Migrating selected authorities 168 to the new blade 502,    -   Starting endpoints 605 on the new blade 502 and including them        in the switch fabric's 146 client connection distribution        algorithm.

From their new locations, migrated authorities 168 persist the contentsof their NVRAM 204 partitions on flash 206, process read and writerequests from other authorities 168, and fulfill the client requeststhat endpoints 605 direct to them. Similarly, if a blade 502 fails or isremoved, the system redistributes its authorities 168 among the system'sremaining blades 502. The redistributed authorities 168 continue toperform their original functions from their new locations.

FIG. 7 depicts authorities 168 and storage resources in blades 502 of astorage cluster, in accordance with some embodiments. Each authority 168is exclusively responsible for a partition of the flash 206 and NVRAM204 on each blade 502. The authority 168 manages the content andintegrity of its partitions independently of other authorities 168.Authorities 168 compress incoming data and preserve it temporarily intheir NVRAM 204 partitions, and then consolidate, RAID-protect, andpersist the data in segments of the storage in their flash 206partitions. As the authorities 168 write data to flash 206, storagemanagers 607 perform the necessary flash translation to optimize writeperformance and maximize media longevity. In the background, authorities168 “garbage collect,” or reclaim space occupied by data that clientshave made obsolete by overwriting the data. It should be appreciatedthat since authorities' 168 partitions are disjoint, there is no needfor distributed locking to execute client and writes or to performbackground functions.

FIG. 8A is an action diagram showing a directory tree and aspecial-named directory 610 for deleting a specified directory 604 andthe entire tree below that directory 604. In this example, thespecial-named directory 610 is “fast_remove”, but the directory couldalso be named “tree_destroy”, “directory_tree_delete” or any otherreserved name to invoke the directory tree deleting properties of thespecial-named directory 610. Unlike ordinary directories 604, thespecial-named directory 610 conceals contents from the user, and doesnot show subdirectories, files, a tree or a partial tree, etc. Moving adirectory 604 to (i.e., under) the special-named directory 610, forexample using a UNIX command my directory_name special-named_directory,directs or requests the storage system to delete the specified directory604 and the entire tree below that directory 604, i.e., the parentdirectory 604 and all subdirectories 606 and all files 608 below thatdirectory 604. Although this is one specific mechanism for requesting atree deletion, other commands for deleting a tree, with or withoutspecifying a special-named directory 610, such as “delete_treedirectory_name” could be devised as an extension to an operating systemor file system.

When the storage system is directed to delete an entire tree, thestorage system establishes a trash list 602, which is then populatedwith names (or other identifying or addressing information) ofdirectories 604, subdirectories 606 and files to be deleted. In FIG. 8A,this process has started, and the specified directory 604, “dir 1”, andsubdirectories 606 “a”, “b” under the specified directory 604 have beenadded to the trash list 602.

FIG. 8B continues the action diagram of FIG. 8A, and shows top-downiterative or recursive listing of a directory 604, subdirectories 606and files 608 in a trash list 602, in some embodiments performed byprocessors 702 on behalf of authorities 168, in iterative search anddestroy 706 processes with batch 704 communication and backgrounddeletions 708. A multitasking computational system can parcel outthreads and processes to perform the iterative search and destroy 706and the background deletions 708 in parallel. In various embodiments asdescribed with reference to FIGS. 1-7 , authorities 168 perform theiterative search and destroy 706 and background deletions 708. Theauthorities 168 communicate among themselves, among storage nodes 150and/or solid state storage units 152 in the storage cluster 160.

In a specific scenario for one embodiment, as shown in FIGS. 8A and 8B,an authority 168 for the special-named directory 610 determines whichauthority 168 is the owner of the Mode for the specified directory 604that has been moved to the special-named directory 610 for treedeletion, and listed in the trash list 602. The special-named directoryowning 610 authority 168 communicates with the specified directory 604owning authority 168, e.g., by sending a message, to initiate thetop-down iterative search and destroy 706 processes. Alternatively,authorities 168 poll or consult the trash list 602 to determine if atask is available. The specified directory 604 owning authority 168determines the contents and respective authorities 168 for the contentsof the specified directory 604, “dir 1”, places those contents (e.g.,names or other identifying information or addresses of subdirectories606 or files 608) on to the trash list 602 and deletes the specifieddirectory 604 from memory and deletes the name of the specifieddirectory 604, or other identification or addressing information, fromthe trash list 602. The link from the specified directory 604 towhichever directory is above, in this case the root directory “/”, issevered, so that the specified directory 604 is no longer visible to thefile system or to a user. Also, the special-named directory 610 concealsvisibility of the specified directory 604 or any contents thereof.

Proceeding top-down, the specified directory 604 owning authority 168communicates to the authorities 168 identified as owning contents of thespecified directory 604, e.g., by sending messages. Alternatively,authorities 168 discover what is on the trash list 602. Thoseauthorities 168 proceed in the same iterative top-down manner,identifying contents of their own directories (now subdirectories 606)and respective authorities 168 for those contents (e.g., files 608and/or further subdirectories 606), placing names, identifyinginformation or addressing of those contents onto the trash list 602 anddeleting the directories (e.g., subdirectories) owned by thoseauthorities 168 and deleting the directories from the trash list 602.So, for example, after being contacted by the authority 168 for thespecified directory 604 “dir 1”, the authority 168 for the subdirectory606 “a” identifies files 608 “A”, “B” and authorities 168 for thosefiles 608, and communicates to those authorities 168, while deleting thedirectory “a” and deleting the name “a” or other identifying or addressinformation for the subdirectory 606 owned by the authority 168 from thetrash list 602. Similarly, the authority 168 for the subdirectory 606“b” identifies files 608 “A”, “B”, “C” and authorities 168 for thosefiles 608, and communicates to those authorities 168, while deleting thedirectory “b” from memory and deleting the name “b” or other identifyingor address information for the subdirectory 606 owned by that authority168 from the trash list 602. Those authorities 168 for the inodes of thefiles 608 place identifying information or addresses for portions of thefiles 608, e.g., segment ID numbers or ranges of segment ID numbers,onto the trash list 602. Respective owners, i.e., authorities 168 insome embodiments, of entries on the trash list 602 perform backgrounddeletions 708 of the directory 604, subdirectories 606 and files 608 orportions of files 608, deleting these entries from the trash list as thebackground deletions 708 are performed. In some embodiments, therequests for performing the iterative search and destroy 706 processes,and the background deletions, are communicated among authorities 168 inbatches 704.

In FIG. 8B, the trash list 602 is shown in various stages, with partialinformation present and deletions from the trash list 602 occurring asother entries are added. For example, in one iteration (at top right ofFIG. 8B), the trash list 602 shows entries for the specified directory604 “dir 1” and subdirectories 606 “a”, “b” and the file 608 “E” beingdeleted through batches 704. Another iteration (at the middle right ofFIG. 8B) has the trash list 602 showing the files 608 “A”, “B” from thesubdirectory 606 “a” and the files 608 “A”, “B”, “C” from thesubdirectory 606 “b”, which will soon be deleted in batches 704.

With ongoing reference to FIGS. 8A and 8B, one mechanism for employingthe trash list 602 is as a communication center for the iterative searchand destroy processes 706 and background deletions 708. When an entry,such as a directory 604, subdirectory 606, or file 608, is placed on thetrash list 602, a background process (e.g., an authority 168 in someembodiments) can pick up that entry and enumerate the entry, that is,list what are the contents of the entry. In the case of a directory 604or subdirectory 606, the background process lists the contents of thedirectory 604 or subdirectory 606 (e.g., more subdirectories 606 and/orfiles 608), and places corresponding entries onto the trash list 602. Inthe case of a file 608, the background process lists portions of thefile, such as are owned by further authorities 168 in variousembodiments. Once the enumeration has been done for the immediatecontents of the directory 604 or subdirectory 606 (i.e., not the entiredepth of the tree), the background process can delete the entry on thetrash list and actually delete or commit to deleting the correspondingitem, such as a directory 604, subdirectory 606, or file 608. Again inthe case of a file 608, that background process could then either deletethe file or contact further authorities 168 each of which could deleteportions of the file owned by those authorities 168, or list theportions of the file on the trash list 602 for deletion by authorities168 that own those portions of the file, in various embodiments. In someembodiments, the background deletions 708 are coordinated with garbagecollection and recovery of physical memory, for example solid statestorage memory. In some embodiments, authorities 168 other than ownersof inodes could take on some of the iterative search and destroy 706 orbackground deletions 708, for example authorities 168 that are not busyperforming reads or writes of user data.

A further benefit of the parallelism in the above mechanisms is thatauthorities 168 exchange batches 704, obtaining tasks according to thetrash list 602, finding entries in directories 604 or subdirectory 606that other authorities should free, and returning memory space forstorage of metadata and user data. In some embodiments, since thefreeing up of storage space is happening in parallel, commitment to datawrites can also be made in parallel. The authorities 168 collectivelycan determine the amount of memory space made available, and schedulewrites in accordance with the memory space available.

It should be appreciated that the deletion of the parent or specifieddirectory 604 “dir 1” referenced in the tree deletion request does notwait for deletion of the leafs at the bottom of the tree (e.g., thefiles 608 at the bottom of FIG. 8B), and can proceed as soon as thespecified directory 604 is placed on the trash list 602. Similarly,deletion of subdirectories 606 can proceed as soon as thesesubdirectories 606 are placed on the trash list 602. Or, deletion canoccur later. Because the deletion of a directory 604 or subdirectory 606does not depend on emptying that directory 604 or subdirectory 606, thebackground deletions 708 can proceed in parallel and in any order.Processing of any subtree can be performed without concern ofconsistency with other processing of other subtrees. Further exampleswith taller or wider directory trees, and other names or conventions fordirectories or files are readily devised in keeping with the teachingsherein. The above-described examples and mechanisms can be extended totrees with hundreds, thousands or millions, etc., of subdirectories andfiles.

With reference back to FIGS. 3-7 , some embodiments of the storagecluster 160 have power loss recovery for the distributed file anddirectory deletion mechanisms described above. In the case of powerloss, the trash list 602 is flushed from NVRAM 204 to flash memory 206(e.g., along with other data and metadata in the system). Upon restart,the trash list is recovered from the flash memory 206, back to NVRAM204. Then, the iterative search and destroy 706 and background deletions708 can continue.

FIG. 9A is a flow diagram of a method for distributed directory and filedeletion of a directory tree, which can be practiced in the storagecluster of FIGS. 1-7 , and in further storage systems, in accordancewith some embodiments as described with reference to FIGS. 8A and 8B.Some or all of the actions in the method can be performed by variousprocessors, such as processors in storage nodes or processors in storageunits. In an action 802, a request is received to move a directory undera special-named directory for tree deletion. That is, a request isreceived to delete a directory and contents. In some embodiments, therequest is specific to the special-named directory and a specifieddirectory for tree deletion, and in other embodiments, the request doesnot mention a special-named directory. In an action 804, proceedingtop-down, directory and contents of the directory are listed to a trashlist. In the decision action 806, it is determined whether there are anysubdirectories below the listed directory. If yes, there is at least onesubdirectory in the directory, flow proceeds to iterate, and returns tothe action 804 to proceed from each subdirectory in a top-down manner tolist the directory and contents of the directory to the trash list.Multiple processes can be spawned in parallel, in some embodiments. Ifno, there is no subdirectory in the directory, then the process is donelisting the entire tree of the directory in the trash list. The actions802, 804, 806 thus show an iterative, recursive, top-down process oflisting directories and contents for an entire directory tree to thetrash list, for deletion.

In the action 808, in a parallel, distributed manner, the directory, allsubdirectories and all files of the entire tree of the directory aredeleted according to the trash list. In the action 810, the paralleldistributed deletions of the action 808 are coordinated with garbagecollection. In the action 812, in parallel with the actions 808, 810,the amount of memory space made available is determined. Authorities inthe storage cluster, freeing up memory space by performing thedeletions, make the determination collectively, in some embodiments. Inthe action 814, writes are scheduled, in accordance with the amount ofmemory space made available. Authorities in the storage cluster schedulethe writes, in some embodiments.

FIG. 9B is a further flow diagram of a method for recovery from powerloss, which can be practiced to augment the method of FIG. 9A. In adecision action 902, it is determined whether there is a power loss. Ifno power loss, flow loops back to the action 902. If yes, there is apower loss, in the action 904 the trash list is flushed from NVRAM tosolid state storage memory. The flushing is supported by an energyreserve in a storage unit, in some embodiments. In an action 906, thestorage system is restarted (e.g., upon restoration of power). In anaction 908, the trash list is recovered from solid-state storage memory.For example, the trash list is read from the flash memory and written tothe NVRAM. In an action 910, the storage system continues deletingsubdirectories and files in accordance with the recovered trash list. Itshould be appreciated that while the embodiments describe a power lossas triggering the actions, this is not meant to be limiting. The actionsmay be triggered by any other faults that interrupt processing in amanner that requires recovery or a restart of the system. That is, theembodiments may be extended to include any type of faults, e.g.,hardware faults, operating system faults, software faults, or networkfaults, that interrupt the process in a way that requires recovery.

FIG. 10 is a further flow diagram of a method for distributed directoryand file deletion of a directory tree, as a variation of the methodshown in FIGS. 9A and 9B. The method of FIG. 10 can be practiced in thestorage cluster of FIGS. 1-7 , and in further storage systems, inaccordance with some embodiments as described with reference to FIGS. 8Aand 8B. Some or all of the actions in the method can be performed byvarious processors, such as processors in storage nodes or processors instorage units. In an action 1002, a request is received to move adirectory under a special-named directory for tree deletion. That is, arequest is received to delete a directory and contents. In someembodiments, the request is specific to the special-named directory anda specified directory for tree deletion, and in other embodiments, therequest does not mention a special-named directory. In an action 1004,the directory is added to a first set. The first set is in a memory inthe storage cluster or other storage system, in some embodiments. In anaction 1006, the first set is operated on, by examining each directoryin the first set looking for subdirectories and files, adding eachdirectory so found to a first set as a directory, adding each file sofound to a second set stored in memory in the storage cluster or otherstorage system, and adding each examined directory to the second set. Insome embodiments, the actions for operating on the first set areperformed by various authorities in a storage cluster.

Still referring to FIG. 10 , in an action 1008, records and data offiles listed in the second set, and records of directories listed in thesecond set are deleted, with no concern for order. As soon as allsub-directories within a parent directory have been identified fordeletion, all other contents in the parent directory can be deleted ascan the parent directory itself. This mechanism can proceed at any rate,and all directories identified as having been processed forsub-directories can be deleted at any rate and in any order, and withany reasonable level of parallelism or distribution across theenvironment. It should be appreciated that this is due to the fact thatthere is no concern with either dangling references, e.g., a referenceto a parent that no longer exists, or with transactional consistency ofthe tree, e.g., whether whatever does or does not remain of thedirectory hierarchy can be reconstructed back into a rooted tree.

This procedure identifies both files and directories for deletion basedon the first set, and deletes both files and directories that have beenadded to the second set which is now of files and directories. Avariation of this procedure identifies directories for deletion based onthe first set, adding subdirectories of each directory examined in thefirst set back to the first set as directories and listing examineddirectories in the second set. The procedure also deletes files found indirectories as well as the directories themselves when the directoriesare found in the second set, i.e., based on the listing of directoriesin the second set. The embodiments also allow deletions from the secondset to proceed in parallel with generation of the second set from thefirst set. In some versions, the second set is used as a source for atrash list described in FIGS. 9A and 9B, and in other versions, thesecond set is the trash list.

The embodiments described above may be integrated with the ability tointroduce a traditional trash delay that allows listing and retrievalfor some period of time (e.g., 24 hours or some other suitable timeperiod). For example, the trash directory can operate by continuing tocontain whatever content is moved into the trash directory. When thetime limit has expired the file or directory is unlinked from the trashdirectory and the procedure described above is then followed to ensureefficient parallel deletion. Thus, in some embodiments, there may be adelay for a time span, responsive to receiving the request in operation1002, wherein the adding, the operating, and the deleting (operations1004, 1006, and 1008) occur upon expiration of the time span, andwherein the contents of the directory are retrievable during the timespan. In some embodiments, rather than a time limit expiring to triggerthe embodiments described above, alternatives such as an additional steptaken to mark a file or directory for immediate removal, perhaps bymoving the file or directory to some other special directory, perhaps byallowing a delete or ‘rmdir’ operation even for a non-empty directory inthe trash directory, or perhaps by running some another special command,may be utilized. A file or directory could be retrieved from the trashdirectory by moving the file or directory out prior to beginning itsparallel removal. Some extended attribute could also be used to recordthe original location, and a utility could be written to restore thefile or directory to its original location in some embodiments.

It should be appreciated that the methods described herein may beperformed with a digital processing system, such as a conventional,general-purpose computer system. Special purpose computers, which aredesigned or programmed to perform only one function may be used in thealternative. FIG. 11 is an illustration showing an exemplary computingdevice which may implement the embodiments described herein. Thecomputing device of FIG. 11 may be used to perform embodiments of thefunctionality for the distributed directory tree (i.e., hierarchy) andfile deletion in accordance with some embodiments. The computing deviceincludes a central processing unit (CPU) 1101, which is coupled througha bus 1105 to a memory 1103, and mass storage device 1107. Mass storagedevice 1107 represents a persistent data storage device such as a floppydisc drive or a fixed disc drive, which may be local or remote in someembodiments. Memory 1103 may include read only memory, random accessmemory, etc. Applications resident on the computing device may be storedon or accessed via a computer readable medium such as memory 1103 ormass storage device 1107 in some embodiments. Applications may also bein the form of modulated electronic signals modulated accessed via anetwork modem or other network interface of the computing device. Itshould be appreciated that CPU 1101 may be embodied in a general-purposeprocessor, a special purpose processor, or a specially programmed logicdevice in some embodiments.

Display 1111 is in communication with CPU 1101, memory 1103, and massstorage device 1107, through bus 1105. Display 1111 is configured todisplay any visualization tools or reports associated with the systemdescribed herein. Input/output device 1109 is coupled to bus 1105 inorder to communicate information in command selections to CPU 1101. Itshould be appreciated that data to and from external devices may becommunicated through the input/output device 1109. CPU 1101 can bedefined to execute the functionality described herein to enable thefunctionality described with reference to FIGS. 1-10 . The codeembodying this functionality may be stored within memory 1103 or massstorage device 1107 for execution by a processor such as CPU 1101 insome embodiments. The operating system on the computing device may beiOS™, MS-WINDOWS™, OS/2™, UNIX™, LINUX™, or other known operatingsystems. It should be appreciated that the embodiments described hereinmay also be integrated with a virtualized computing system that isimplemented with physical computing resources.

It should be understood that although the terms first, second, etc. maybe used herein to describe various steps or calculations, these steps orcalculations should not be limited by these terms. These terms are onlyused to distinguish one step or calculation from another. For example, afirst calculation could be termed a second calculation, and, similarly,a second step could be termed a first step, without departing from thescope of this disclosure. As used herein, the term “and/or” and the “/”symbol includes any and all combinations of one or more of theassociated listed items.

As used herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”,“comprising”, “includes”, and/or “including”, when used herein, specifythe presence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof. Therefore, the terminology usedherein is for the purpose of describing particular embodiments only andis not intended to be limiting.

It should also be noted that in some alternative implementations, thefunctions/acts noted may occur out of the order noted in the figures.For example, two figures shown in succession may in fact be executedsubstantially concurrently or may sometimes be executed in the reverseorder, depending upon the functionality/acts involved.

With the above embodiments in mind, it should be understood that theembodiments might employ various computer-implemented operationsinvolving data stored in computer systems. These operations are thoserequiring physical manipulation of physical quantities. Usually, thoughnot necessarily, these quantities take the form of electrical ormagnetic signals capable of being stored, transferred, combined,compared, and otherwise manipulated. Further, the manipulationsperformed are often referred to in terms, such as producing,identifying, determining, or comparing. Any of the operations describedherein that form part of the embodiments are useful machine operations.The embodiments also relate to a device or an apparatus for performingthese operations. The apparatus can be specially constructed for therequired purpose, or the apparatus can be a general-purpose computerselectively activated or configured by a computer program stored in thecomputer. In particular, various general-purpose machines can be usedwith computer programs written in accordance with the teachings herein,or it may be more convenient to construct a more specialized apparatusto perform the required operations.

A module, an application, a layer, an agent or other method-operableentity could be implemented as hardware, firmware, or a processorexecuting software, or combinations thereof. It should be appreciatedthat, where a software-based embodiment is disclosed herein, thesoftware can be embodied in a physical machine such as a controller. Forexample, a controller could include a first module and a second module.A controller could be configured to perform various actions, e.g., of amethod, an application, a layer or an agent.

The embodiments can also be embodied as computer readable code on anon-transitory computer readable medium. The computer readable medium isany data storage device that can store data, which can be thereafterread by a computer system. Examples of the computer readable mediuminclude hard drives, network attached storage (NAS), read-only memory,random-access memory, CD-ROMs, CD-Rs, CD-RWs, magnetic tapes, and otheroptical and non-optical data storage devices. The computer readablemedium can also be distributed over a network coupled computer system sothat the computer readable code is stored and executed in a distributedfashion. Embodiments described herein may be practiced with variouscomputer system configurations including hand-held devices, tablets,microprocessor systems, microprocessor-based or programmable consumerelectronics, minicomputers, mainframe computers and the like. Theembodiments can also be practiced in distributed computing environmentswhere tasks are performed by remote processing devices that are linkedthrough a wire-based or wireless network.

Although the method operations were described in a specific order, itshould be understood that other operations may be performed in betweendescribed operations, described operations may be adjusted so that theyoccur at slightly different times or the described operations may bedistributed in a system which allows the occurrence of the processingoperations at various intervals associated with the processing.

In various embodiments, one or more portions of the methods andmechanisms described herein may form part of a cloud-computingenvironment. In such embodiments, resources may be provided over theInternet as services according to one or more various models. Suchmodels may include Infrastructure as a Service (IaaS), Platform as aService (PaaS), and Software as a Service (SaaS). In IaaS, computerinfrastructure is delivered as a service. In such a case, the computingequipment is generally owned and operated by the service provider. Inthe PaaS model, software tools and underlying equipment used bydevelopers to develop software solutions may be provided as a serviceand hosted by the service provider. SaaS typically includes a serviceprovider licensing software as a service on demand. The service providermay host the software, or may deploy the software to a customer for agiven period of time. Numerous combinations of the above models arepossible and are contemplated.

Various units, circuits, or other components may be described or claimedas “configured to” or “configurable to” perform a task or tasks. In suchcontexts, the phrase “configured to” or “configurable to” is used toconnote structure by indicating that the units/circuits/componentsinclude structure (e.g., circuitry) that performs the task or tasksduring operation. As such, the unit/circuit/component can be said to beconfigured to perform the task, or configurable to perform the task,even when the specified unit/circuit/component is not currentlyoperational (e.g., is not on). The units/circuits/components used withthe “configured to” or “configurable to” language include hardware—forexample, circuits, memory storing program instructions executable toimplement the operation, etc. Reciting that a unit/circuit/component is“configured to” perform one or more tasks, or is “configurable to”perform one or more tasks, is expressly intended not to invoke 35 U.S.C.112, sixth paragraph, for that unit/circuit/component. Additionally,“configured to” or “configurable to” can include generic structure(e.g., generic circuitry) that is manipulated by software and/orfirmware (e.g., an FPGA or a general-purpose processor executingsoftware) to operate in manner that is capable of performing the task(s)at issue. “Configured to” may also include adapting a manufacturingprocess (e.g., a semiconductor fabrication facility) to fabricatedevices (e.g., integrated circuits) that are adapted to implement orperform one or more tasks. “Configurable to” is expressly intended notto apply to blank media, an unprogrammed processor or unprogrammedgeneric computer, or an unprogrammed programmable logic device,programmable gate array, or other unprogrammed device, unlessaccompanied by programmed media that confers the ability to theunprogrammed device to be configured to perform the disclosedfunction(s).

The foregoing description, for the purpose of explanation, has beendescribed with reference to specific embodiments. However, theillustrative discussions above are not intended to be exhaustive or tolimit the invention to the precise forms disclosed. Many modificationsand variations are possible in view of the above teachings. Theembodiments were chosen and described in order to best explain theprinciples of the embodiments and its practical applications, to therebyenable others skilled in the art to best utilize the embodiments andvarious modifications as may be suited to the particular usecontemplated. Accordingly, the present embodiments are to be consideredas illustrative and not restrictive, and the invention is not to belimited to the details given herein, but may be modified within thescope and equivalents of the appended claims.

What is claimed is:
 1. A method, comprising: receiving a request todelete a directory and contents of the directory; adding the directoryto a first set, listed in a memory in a storage system; addingsubdirectories associated with the directory to the first set; addingthe directory and the subdirectories of the first set to a second set inthe memory; deleting in a distributed manner across the storage system,contents of the directory and the subdirectories listed in the secondset.
 2. The method of claim 1 further comprising: delaying for a timespan the deleting, and wherein the contents of the directory and thesubdirectories are retrievable during the time span.
 3. The method ofclaim 1, wherein the receiving the request comprises: generating arequest to move the directory under a named directory that conceals thedirectory and contents.
 4. The method of claim 1, further comprising:communicating a plurality of batch lists to a plurality of processors inthe storage system, the plurality of batch lists listing a subset of thedirectory, wherein the deleting the directory is in accordance with theplurality of batch lists.
 5. The method of claim 1, further comprising:scheduling a plurality of writes to the storage system, in accordancewith determining an amount of memory space made available by the requestto delete the directory and in parallel with the deleting.
 6. The methodof claim 1, wherein the deleting in a distributed manner across thestorage system, the contents of the directory further comprises deletingdata and records of the files listed in the second set and wherein thedeleting is performed without concern for order.
 7. The method of claim1, wherein the deleting comprises: coordinating the deleting of thedirectory with garbage collection in a plurality of solid-state storageunits of the storage system.
 8. The method of claim 1, furthercomprising: writing directory names of the directories listed in thesecond set and all files of the directories listed in the second set toa trash list in NVRAM (nonvolatile random-access memory) of the storagesystem; and flushing the trash list from the NVRAM to solid-statestorage memory in the storage system, responsive to detecting a powerloss in the storage system.
 9. A tangible, non-transitory,computer-readable media having instructions thereupon which, whenexecuted by a processor, cause the processor to perform a methodcomprising: receiving a request to delete a directory and contents ofthe directory; adding the directory to a first set, listed in a memoryin a storage system; adding subdirectories associated with the directoryto the first set; adding the directory and the subdirectories of thefirst set to a second set in the memory; deleting in a distributedmanner across the storage system, contents of the directory and thesubdirectories listed in the second set.
 10. The method of claim 9further comprising: delaying for a time span the deleting, and whereinthe contents of the directory and the subdirectories are retrievableduring the time span.
 11. The computer-readable media of claim 9,wherein the receiving the request comprises: generating a request tomove the directory under a named directory that conceals the directoryand contents to a client.
 12. The computer-readable media of claim 9,wherein the method further comprises: communicating a plurality of batchlists to a plurality of processors in the storage system, the pluralityof batch lists listing a subset of the directory, wherein the deletingthe directory is in accordance with the plurality of batch lists. 13.The computer-readable media of claim 9, wherein the method furthercomprises: determining an amount of memory space made available by therequest to delete the directory; and scheduling a plurality of writes tothe storage system, in accordance with the determining and in parallelwith the deleting.
 14. The computer-readable media of claim 9, whereinthe deleting is performed by a plurality of authorities in the storagesystem, with each inode, range of data, and sub-directory owned by anauthority.
 15. The computer-readable media of claim 9, wherein thedeleting comprises: coordinating the deleting of the directory withgarbage collection in each of a plurality of solid-state storage unitsof the storage system and wherein the deleting is performed withoutconcern for order.
 16. A storage system with distributed file deletion,comprising: storage memory; and a plurality of storage nodes, eachhaving one or more processors, the plurality of storage nodesconfigurable to cooperate to perform a method comprising: receiving arequest to delete a directory and contents of the directory; adding thedirectory to a first set, listed in a memory in a storage system; addingsubdirectories associated with the directory to the first set; addingthe directory and the subdirectories of the first set to a second set inthe memory; deleting in a distributed manner across the storage system,contents of the directory and the subdirectories listed in the secondset.
 17. The storage system of claim 15, further comprising: delayingfor a time span the deleting, and wherein the contents of the directoryare retrievable during the time span.
 18. The storage system of claim15, wherein the receiving the request comprises: generating a request tomove the directory under a named directory that conceals the directoryand contents, and wherein the deleting is performed without concern fororder.
 19. The storage system of claim 15, wherein the method furthercomprises: communicating a plurality of batch lists to a plurality ofprocessors in the storage system, the plurality of batch lists listing asubset of the directory, wherein the deleting the directory is inaccordance with the plurality of batch lists.
 20. The storage system ofclaim 15, wherein the deleting comprises: coordinating the deleting ofthe directory with garbage collection in each of a plurality ofsolid-state storage units of the storage system.